home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 6 / MacMania 6.toast / / Tools&Utilities / EnterAct Stuff / Indent project / Indent Source / sys.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-24  |  2.4 KB  |  102 lines  |  [TEXT/MPS ]

  1. /* Copyright (c) 1993,1994, Joseph Arceneaux.  All rights reserved.
  2.  
  3.    This file is subject to the terms of the GNU General Public License as
  4.    published by the Free Software Foundation.  A copy of this license is
  5.    included with this software distribution in the file COPYING.  If you
  6.    do not have a copy, you may obtain a copy by writing to the Free
  7.    Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  8.  
  9.    This software is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details. */
  13.  
  14. #include <stdio.h>
  15.  
  16. /* Values of special characters. */
  17. #define TAB '\t'
  18. #define EOL '\n'
  19. #define BACKSLASH '\\'
  20.  
  21. #ifdef DEBUG
  22. extern int debug;
  23. #endif
  24.  
  25. #ifdef __GNUC__
  26. #define INLINE __inline__
  27. #else
  28. #define INLINE
  29. #endif
  30.  
  31. #ifdef VMS
  32. # define ONE_DOT_PER_FILENAME 1
  33. # define NODIR 1
  34. # define PROFILE_FORMAT "%s%s"
  35. # define BACKUP_SUFFIX_STR    "_"
  36. # define BACKUP_SUFFIX_CHAR   '_'
  37. # define BACKUP_SUFFIX_FORMAT "%s._%d_"
  38. # define SYS_READ vms_read    /* Defined in io.c */
  39. # ifdef VAXC
  40. #  include <unixio.h>
  41. # endif
  42. #endif /* VMS */
  43.  
  44. #ifdef __MSDOS__
  45. # define ONE_DOT_PER_FILENAME 1
  46. # ifndef __GNUC__
  47. # define USG   1
  48. # endif
  49. # define NODIR 1
  50. #endif /* __MSDOS__ */
  51.  
  52. #ifdef __MWERKS__
  53. # define NODIR 1
  54. # define USG   1
  55. #endif
  56.  
  57. /* configure defines USG if it can't find bcopy */
  58.  
  59. #ifndef USG
  60. #define memcpy(dest,src,len) bcopy((src),(dest),len)
  61. #endif
  62.  
  63. struct file_buffer
  64. {
  65.   char *name;
  66.   unsigned long size;
  67.   char *data;
  68. };
  69.  
  70. extern struct file_buffer *read_file (char *filename);
  71. extern struct file_buffer *read_stdin (void);
  72.  
  73. /* Standard memory allocation routines etc.  */
  74. //char *malloc();
  75. //char *realloc();
  76. #include <stdlib.h>
  77.  
  78. /* Similar, but abort with an error if out of memory (see globs.c).  */
  79. //char *xmalloc(unsigned);
  80. //char *xrealloc(char *, unsigned);
  81. char *xmalloc(size_t);
  82. char *xrealloc(char *, size_t, char *);
  83.  
  84. // Special stuff for the dragon module version:
  85. #ifdef __MWERKS__
  86. #include "CodeResHelper.h" /* FMalloc etc */
  87. extern void JumpOnIndentError(short inputErrorNumber);
  88.  
  89. #define malloc(x) Fmalloc(x)
  90. #define realloc(x, y) Frealloc(x, y)
  91. #define free(x) Ffree(x)
  92.  
  93. #define abort() JumpOnIndentError(4)
  94. #define exit(x) JumpOnIndentError(x)
  95. #define popen(str, w) NULL
  96. #define pclose(x) 1
  97. #define CheckForInterrupt() if (TaskWasInterrupted()) JumpOnIndentError(999)
  98.  
  99. //extern jmp_buf        envBuf;
  100.  
  101. #endif
  102.